<?php

	class ModuleFileVO
	{
		var $module;
		var $filename;
		var $type;
		
		var $_explicitType = "Core.ModuleFile";
						
		/*function getFile()
		{
			$folder;
		
			if ($this->type == MODULE_FILE_MODEL || $this->type == MODULE_FILE_VO)
			{
				$folder = FOLDER_MODEL;
			}
			else if ($this->type == MODULE_FILE_COMMAND || $this->type == MODULE_FILE_FILTER)
			{
				$folder = FOLDER_CONTROLLER;
			}
			else
			{
				$folder = FOLDER_VIEW;
			}
			
			return MODULES_PATH.$this->module."/".$folder."/".$this->filename.$this->type.".php";
		}
		
		function newInstance()
		{
			$this->includeFile();
			
			$reflectionClass = new ReflectionClass($this->filename.$this->type);
			
			return $reflectionClass->newInstance();
		}
			
		function includeFile($data = null)
		{
			if ($this->fileExists())
			{
				if (!is_null($data))
				{
					extract($data,EXTR_PREFIX_SAME,"_");
				}
				
				include (EBUILDY_PATH."component_vars.inc.php");
			
				include_once($this->getFile());
			}
			else
			{
				throw new Exception("Cannot include <b>".$this->type."</b> : <b>".$this->filename."</b> of the module <b>".$this->module."</b>:<br /><i>".$this->getFile()."</i>");
			}
		}
		
		function fileExists()
		{
			return file_exists($this->getFile());
		}*/
	}